package com.ruoyi.lclook.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lclook.mapper.LcBannerMapper;
import com.ruoyi.lclook.domain.LcBanner;
import com.ruoyi.lclook.service.ILcBannerService;

/**
 * 海报Service业务层处理
 * 
 * @author Choi
 * @date 2021-08-07
 */
@Service
public class LcBannerServiceImpl implements ILcBannerService 
{
    @Autowired
    private LcBannerMapper lcBannerMapper;

    /**
     * 查询海报
     * 
     * @param id 海报ID
     * @return 海报
     */
    @Override
    public LcBanner selectLcBannerById(Long id)
    {
        return lcBannerMapper.selectLcBannerById(id);
    }

    /**
     * 查询海报列表
     * 
     * @param lcBanner 海报
     * @return 海报
     */
    @Override
    public List<LcBanner> selectLcBannerList(LcBanner lcBanner)
    {
        return lcBannerMapper.selectLcBannerList(lcBanner);
    }

    /**
     * 新增海报
     * 
     * @param lcBanner 海报
     * @return 结果
     */
    @Override
    public int insertLcBanner(LcBanner lcBanner)
    {
        lcBanner.setCreateTime(DateUtils.getNowDate());
        return lcBannerMapper.insertLcBanner(lcBanner);
    }

    /**
     * 修改海报
     * 
     * @param lcBanner 海报
     * @return 结果
     */
    @Override
    public int updateLcBanner(LcBanner lcBanner)
    {
        lcBanner.setUpdateTime(DateUtils.getNowDate());
        return lcBannerMapper.updateLcBanner(lcBanner);
    }

    /**
     * 批量删除海报
     * 
     * @param ids 需要删除的海报ID
     * @return 结果
     */
    @Override
    public int deleteLcBannerByIds(Long[] ids)
    {
        return lcBannerMapper.deleteLcBannerByIds(ids);
    }

    /**
     * 删除海报信息
     * 
     * @param id 海报ID
     * @return 结果
     */
    @Override
    public int deleteLcBannerById(Long id)
    {
        return lcBannerMapper.deleteLcBannerById(id);
    }
}
